Arnav Krishnan - Hash Analysis

  1. Analysis of Input

Left: Data Set B; Right: Data Set D.

  1. Analysis of Performance

Blue, Red, Yellow, and Green lines correspond to:

Contains-hit, Contains-miss, Remove, and Add

  1.  
  2.  
  3. Comparison of Hash Implementations

Strengths and Weaknesses:

  1. Reflection

Through this assignment I gained a much deeper understanding of hashes, a data structure that I had previously not known about. Even during our hashes unit, while I was able to better understand the differences between Linear Probing, Quadratic Probing, Linked List, and Cuckoo implementations, this analysis helped me see the actual performance differences between them. For instance, seeing how Cuckoo had incredibly fast lookup times, but terrible memory utilization showed me the tradeoffs between different methods. And in a more general sense, this assignment taught me to come in with a hypothesis, but to accept when the data contradicts that hypothesis. And rather than trying to make the data fit my preconceptions, I should try and see the story that the data is telling, and understand why I got the results I did. The performance difference between datasets B and D was quite literally the opposite of what I predicted, and it was really cool to figure out why.

To be honest, the most challenging part of this assignment was creating the graphs. Although it wasn’t the ‘core idea’ of the unit (as opposed to coding the hash implementations), it gave me a deeper understanding of the work that goes into data analysis. Indeed, collecting data is just one part of understanding successes and failures. However, in terms of the actual coding, the place_cuckoo() method was by far the most difficult. I used a recursive strategy, going through both hashes on each recursive step, which worked quite well, though it did take me some time to figure out.

One thing that surprised me was the effect that dataSetD’s bimodal distribution had on most hash types (LP, QP, LL, NOT Cuckoo). I expected much worse performance across the board, but really LP and QP showed a (albeit slight) improvement in performance! This suggests that the hash function itself was doing a reasonable job of dispersing the clustered inputs across the table.

One thing I wonder is how these implementations would scale with much larger datasets. I wonder this because our table started at 10,009 but real applications may use millions, if not more, entries. One more thing I wonder is whether a different hash function could eliminate, or exacerbate, the performance gap between datasets B and D.